#ifndef MUSICSLIDER_H
#define MUSICSLIDER_H

#include <QWidget>
#include <QMouseEvent>

namespace Ui {
class MusicSlider;
}

class MusicSlider : public QWidget
{
    Q_OBJECT

public:
    explicit MusicSlider(QWidget *parent = nullptr);
    ~MusicSlider();
    //根据currentPos调整宽度
    void moveSlider();
    //根据音乐播放进度 , 设置进度条进度
    void setStep(float);
protected:
    void mouseMoveEvent(QMouseEvent* event) override;
    void mousePressEvent(QMouseEvent* event) override;
    void mouseReleaseEvent(QMouseEvent* event) override;

signals:
    void setMusicSlider(float);

private:
    Ui::MusicSlider *ui;
    int currentPos;//当前进度
};

#endif // MUSICSLIDER_H
